class MaddreyDiscriminantFunctionorAlcoholicHepatitis():
    def __init__(self):
        # http://doctor-network.com/public/littletools/37.html
        pass

    def calc(self, data):
        """
        酒精性肝病MDF评分
        """
        PTOP = int(data['PTOP'])  # 患者凝血酶原时间 Prothrombin time of patients
        CPT = int(data['CPT'])  # 对照凝血酶原时间 Control prothrombin time
        STB = float(data['STB'])  # 患者血清总胆红素 Serum total bilirubin
        MDF = round(4.6* (PTOP - CPT)+STB, 2)
        if MDF>=32:
            return {"MDF": MDF, "status": "死亡高风险，1个月内的病死率高达30%～50%，尤其合并有肝性脑病者将处于最高的风险"}
        else:
            return {"MDF": MDF}


if __name__ == '__main__':
    print(MaddreyDiscriminantFunctionorAlcoholicHepatitis().calc({"PTOP": "78", "CPT": "76", "STB": "1.3"}))
